$(document).ready(function () {
    function refreshCaptcha() {
        let path = "/captcha?r=" + Math.random();
        document.getElementById("captcha").src = path;
    }

    layui.config({
        version: '1.0',
        base: './js/'  // 这里注意根路径前面加.
    }).extend({ //设定模块别名
        app: 'app'
    });

    layui.use(['form','app'], function () {
        var form = layui.form;
        var app = layui.app;

        //监听提交
        form.on('submit(login)', function (data) {

            app.login(data.field);
            return false;
        });
    });

})

